<!DOCTYPE html>
<title>Test that a "source" element is not used when "src" attribute is set.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video>
    <source></source>
</video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    var mediaFile = "content/test.ogv";

    video.onloadstart = t.step_func_done(function() {
        var url = video.currentSrc;
        assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
    });

    document.querySelector("source").src = "content/error.mpeg";
    video.src = mediaFile;
});
</script>